<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\Seek
 *
 * @property int $id
 * @property string|null $name 影视名称
 * @property int|null $user_id 用户id
 * @property string|null $phone 手机号码
 * @property int|null $status 0未处理 1已处理
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property-read \App\Models\User|null $user
 * @method static \Illuminate\Database\Eloquent\Builder|Seek newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|Seek newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|Seek query()
 * @method static \Illuminate\Database\Eloquent\Builder|Seek whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Seek whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Seek whereName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Seek wherePhone($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Seek whereStatus($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Seek whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|Seek whereUserId($value)
 * @mixin \Eloquent
 */
class Seek extends Model
{
    //
    protected $table = 'seek';
    public $timestamps = true;
    //连接user表
    public function user()
    {
        return $this->hasOne('App\Models\User','id','user_id');
    }
    public function setCreatedAtAttribute($value)
    {
        $this->attributes['created_at'] = strtotime($value);
    }

    public function setUpdatedAtAttribute($value)
    {
        $this->attributes['updated_at'] = strtotime($value);
    }
}
